<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
    <meta name="Content-Type" content="text/html; charset=utf-8" />
<title>Class: Ensembl::Core::Intron</title>
<link rel="stylesheet" href="../../css/style.css" type="text/css" media="screen" charset="utf-8" />
<link rel="stylesheet" href="../../css/common.css" type="text/css" media="screen" charset="utf-8" />

<script type="text/javascript" charset="utf-8">
  relpath = '../..';
  if (relpath != '') relpath += '/';
</script>
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>

  </head>
  <body>
    <script type="text/javascript" charset="utf-8">
      if (window.top.frames.main) document.body.className = 'frames';
    </script>
    
    <div id="header">
      <div id="menu">
  
    <a href="../../_index.html">Index (I)</a> &raquo; 
    <span class='title'><span class='object_link'><a href="../../Ensembl.html" title="Ensembl (module)">Ensembl</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../Core.html" title="Ensembl::Core (module)">Core</a></span></span>
     &raquo; 
    <span class="title">Intron</span>
  
  
  <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
</div>

      <div id="search">
  <a id="class_list_link" href="#">Class List</a>
  <a id="method_list_link" href="#">Method List</a>
  <a id ="file_list_link" href="#">File List</a>
</div>

      <div class="clear"></div>
    </div>
    
    <iframe id="search_frame"></iframe>
    
    <div id="content"><h1>Class: Ensembl::Core::Intron
  
  
  
</h1>

<dl class="box">
  
    <dt class="r1">Inherits:</dt>
    <dd class="r1">
      <span class="inheritName">Object</span>
      
        <ul class="fullTree">
          <li>Object</li>
          
            <li class="next">Ensembl::Core::Intron</li>
          
        </ul>
        <a href="#" class="inheritanceTree">show all</a>
      
      </dd>
    
  
  
    
  
    
      <dt class="r2">Includes:</dt>
      <dd class="r2"><span class='object_link'><a href="Sliceable.html" title="Ensembl::Core::Sliceable (module)">Sliceable</a></span></dd>
      
    
  
  
  
    <dt class="r1 last">Defined in:</dt>
    <dd class="r1 last">lib/ensembl/core/transcript.rb</dd>
  
</dl>
<div class="clear"></div>

<h2>Overview</h2><div class="docstring">
  <div class="discussion">
    <p>
The Intron class describes an intron.
</p>
<p>
This class does <em>not</em> use ActiveRecord and is only defined within
the API. There is no <em>introns</em> table in the Ensembl database.
</p>
<p>
This class includes the mixin Sliceable, which means that it is mapped to a
SeqRegion object and a Slice can be created for objects o this class. See
Sliceable and Slice for more information.
</p>


  </div>
</div>
<div class="tags">
  
  <div class="examples">
    <h3>Examples:</h3>
    
      <h4><div class='inline'></div></h4>
      <pre class="example code"><span class='exon1 identifier id'>exon1</span> <span class='assign token'>=</span> <span class='Ensembl constant id'>Ensembl</span><span class='colon2 op'>::</span><span class='Core constant id'>Core</span><span class='colon2 op'>::</span><span class='Exon constant id'>Exon</span><span class='dot token'>.</span><span class='find identifier id'>find</span><span class='lparen token'>(</span><span class='integer val'>292811</span><span class='rparen token'>)</span>
<span class='exon2 identifier id'>exon2</span> <span class='assign token'>=</span> <span class='Ensembl constant id'>Ensembl</span><span class='colon2 op'>::</span><span class='Core constant id'>Core</span><span class='colon2 op'>::</span><span class='Exon constant id'>Exon</span><span class='dot token'>.</span><span class='find identifier id'>find</span><span class='lparen token'>(</span><span class='integer val'>292894</span><span class='rparen token'>)</span>
<span class='intron identifier id'>intron</span> <span class='assign token'>=</span> <span class='Ensembl constant id'>Ensembl</span><span class='colon2 op'>::</span><span class='Core constant id'>Core</span><span class='colon2 op'>::</span><span class='Intron constant id'>Intron</span><span class='dot token'>.</span><span class='new identifier id'>new</span><span class='lparen token'>(</span><span class='exon1 identifier id'>exon1</span><span class='comma token'>,</span><span class='exon2 identifier id'>exon2</span><span class='rparen token'>)</span>
<span class='puts identifier id'>puts</span> <span class='intron identifier id'>intron</span><span class='dot token'>.</span><span class='to_yaml identifier id'>to_yaml</span>

<span class='transcript identifier id'>transcript</span> <span class='assign token'>=</span> <span class='Ensembl constant id'>Ensembl</span><span class='colon2 op'>::</span><span class='Core constant id'>Core</span><span class='colon2 op'>::</span><span class='Transcript constant id'>Transcript</span><span class='dot token'>.</span><span class='find identifier id'>find</span><span class='lparen token'>(</span><span class='integer val'>58972</span><span class='rparen token'>)</span>
<span class='puts identifier id'>puts</span> <span class='transcript identifier id'>transcript</span><span class='dot token'>.</span><span class='introns identifier id'>introns</span><span class='dot token'>.</span><span class='to_yaml identifier id'>to_yaml</span>
</pre>
    
  </div>

</div>

  
  
  
  
  <h2>Instance Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
  <ul class="summary">
    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#next_exon-instance_method" title="#next_exon (instance method)">- (Object) <strong>next_exon</strong> </a>
    

    
  </span>
  
  
    
    
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>
Returns the value of attribute next_exon.
</p>
</div></span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#previous_exon-instance_method" title="#previous_exon (instance method)">- (Object) <strong>previous_exon</strong> </a>
    

    
  </span>
  
  
    
    
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>
Returns the value of attribute previous_exon.
</p>
</div></span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#seq_region-instance_method" title="#seq_region (instance method)">- (Object) <strong>seq_region</strong> </a>
    

    
  </span>
  
  
    
    
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>
Returns the value of attribute seq_region.
</p>
</div></span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#seq_region_end-instance_method" title="#seq_region_end (instance method)">- (Object) <strong>seq_region_end</strong> </a>
    

    
  </span>
  
  
    
    
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>
Returns the value of attribute seq_region_end.
</p>
</div></span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#seq_region_start-instance_method" title="#seq_region_start (instance method)">- (Object) <strong>seq_region_start</strong> </a>
    

    
  </span>
  
  
    
    
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>
Returns the value of attribute seq_region_start.
</p>
</div></span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#seq_region_strand-instance_method" title="#seq_region_strand (instance method)">- (Object) <strong>seq_region_strand</strong> </a>
    

    
  </span>
  
  
    
    
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>
Returns the value of attribute seq_region_strand.
</p>
</div></span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#transcript-instance_method" title="#transcript (instance method)">- (Object) <strong>transcript</strong> </a>
    

    
  </span>
  
  
    
    
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>
Returns the value of attribute transcript.
</p>
</div></span>
  
</li>

    
  </ul>


  
    <h2>
      Instance Method Summary
      <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
    </h2>

    <ul class="summary">
      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#initialize-instance_method" title="#initialize (instance method)">- (Intron) <strong>initialize</strong>(exon_1, exon_2) </a>
    

    
  </span>
  
    <span class="note title constructor">constructor</span>
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>
A new instance of Intron.
</p>
</div></span>
  
</li>

      
    </ul>
  


  
  
  
  
  
  
  
  <h3 class="inherited">Methods included from <span class='object_link'><a href="Sliceable.html" title="Ensembl::Core::Sliceable (module)">Sliceable</a></span></h3>
  <p class="inherited"><span class='object_link'><a href="Sliceable.html#length-instance_method" title="Ensembl::Core::Sliceable#length (method)">#length</a></span>, <span class='object_link'><a href="Sliceable.html#project-instance_method" title="Ensembl::Core::Sliceable#project (method)">#project</a></span>, <span class='object_link'><a href="Sliceable.html#seq-instance_method" title="Ensembl::Core::Sliceable#seq (method)">#seq</a></span>, <span class='object_link'><a href="Sliceable.html#slice-instance_method" title="Ensembl::Core::Sliceable#slice (method)">#slice</a></span>, <span class='object_link'><a href="Sliceable.html#start-instance_method" title="Ensembl::Core::Sliceable#start (method)">#start</a></span>, <span class='object_link'><a href="Sliceable.html#stop-instance_method" title="Ensembl::Core::Sliceable#stop (method)">#stop</a></span>, <span class='object_link'><a href="Sliceable.html#strand-instance_method" title="Ensembl::Core::Sliceable#strand (method)">#strand</a></span>, <span class='object_link'><a href="Sliceable.html#transform-instance_method" title="Ensembl::Core::Sliceable#transform (method)">#transform</a></span></p>
<div id="constructor_details" class="method_details_list">
  <h2>Constructor Details</h2>
  
    <div class="method_details first">
  <p class="signature first" id="initialize-instance_method">
  
    - (<tt><span class='object_link'><a href="" title="Ensembl::Core::Intron (class)">Intron</a></span></tt>) <strong>initialize</strong>(exon_1, exon_2) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>
A new instance of Intron
</p>


  </div>
</div>
<div class="tags">
  <h3>Raises:</h3>
<ul class="raise">
  
    <li>
      
        <span class='type'>(<tt>ArgumentError</tt>)</span>
      
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/ensembl/core/transcript.rb', line 34</span>

<span class='def def kw'>def</span> <span class='initialize identifier id'>initialize</span><span class='lparen token'>(</span><span class='exon_1 identifier id'>exon_1</span><span class='comma token'>,</span> <span class='exon_2 identifier id'>exon_2</span><span class='rparen token'>)</span>
  <span class='comment val'># Check if these are actually two adjacent exons from the same transcript</span>
  <span class='ok identifier id'>ok</span> <span class='assign token'>=</span> <span class='true true kw'>true</span>

  <span class='transcript identifier id'>transcript</span> <span class='assign token'>=</span> <span class='nil nil kw'>nil</span>
  <span class='exon_1 identifier id'>exon_1</span><span class='dot token'>.</span><span class='transcripts identifier id'>transcripts</span><span class='dot token'>.</span><span class='each identifier id'>each</span> <span class='do do kw'>do</span> <span class='bitor op'>|</span><span class='t identifier id'>t</span><span class='bitor op'>|</span>
    <span class='transcript identifier id'>transcript</span> <span class='assign token'>=</span> <span class='t identifier id'>t</span> <span class='if if_mod kw'>if</span> <span class='exon_2 identifier id'>exon_2</span><span class='dot token'>.</span><span class='transcripts identifier id'>transcripts</span><span class='dot token'>.</span><span class='include? fid id'>include?</span><span class='lparen token'>(</span><span class='t identifier id'>t</span><span class='rparen token'>)</span>
  <span class='end end kw'>end</span>
  <span class='raise identifier id'>raise</span> <span class='ArgumentError constant id'>ArgumentError</span><span class='comma token'>,</span> <span class='string val'>&quot;Arguments should be adjacent exons of same transcript&quot;</span> <span class='if if_mod kw'>if</span> <span class='transcript identifier id'>transcript</span><span class='dot token'>.</span><span class='nil? fid id'>nil?</span>
  
  <span class='rank_1 identifier id'>rank_1</span> <span class='assign token'>=</span> <span class='ExonTranscript constant id'>ExonTranscript</span><span class='dot token'>.</span><span class='find_by_transcript_id_and_exon_id identifier id'>find_by_transcript_id_and_exon_id</span><span class='lparen token'>(</span><span class='transcript identifier id'>transcript</span><span class='dot token'>.</span><span class='id identifier id'>id</span><span class='comma token'>,</span> <span class='exon_1 identifier id'>exon_1</span><span class='dot token'>.</span><span class='id identifier id'>id</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='rank identifier id'>rank</span>
  <span class='rank_2 identifier id'>rank_2</span> <span class='assign token'>=</span> <span class='ExonTranscript constant id'>ExonTranscript</span><span class='dot token'>.</span><span class='find_by_transcript_id_and_exon_id identifier id'>find_by_transcript_id_and_exon_id</span><span class='lparen token'>(</span><span class='transcript identifier id'>transcript</span><span class='dot token'>.</span><span class='id identifier id'>id</span><span class='comma token'>,</span> <span class='exon_2 identifier id'>exon_2</span><span class='dot token'>.</span><span class='id identifier id'>id</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='rank identifier id'>rank</span>
  <span class='raise identifier id'>raise</span> <span class='ArgumentError constant id'>ArgumentError</span><span class='comma token'>,</span> <span class='string val'>&quot;Arguments should be adjacent exons of same transcript&quot;</span> <span class='if if_mod kw'>if</span> <span class='lparen token'>(</span><span class='rank_2 identifier id'>rank_2</span> <span class='minus op'>-</span> <span class='rank_1 identifier id'>rank_1</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='abs identifier id'>abs</span> <span class='gt op'>&gt;</span> <span class='integer val'>1</span>
  
  <span class='@previous_exon ivar id'>@previous_exon</span><span class='comma token'>,</span> <span class='@next_exon ivar id'>@next_exon</span> <span class='assign token'>=</span> <span class='lbrack token'>[</span><span class='exon_1 identifier id'>exon_1</span><span class='comma token'>,</span> <span class='exon_2 identifier id'>exon_2</span><span class='rbrack token'>]</span><span class='dot token'>.</span><span class='sort_by identifier id'>sort_by</span><span class='lbrace token'>{</span><span class='bitor op'>|</span><span class='e identifier id'>e</span><span class='bitor op'>|</span> <span class='e identifier id'>e</span><span class='dot token'>.</span><span class='seq_region_start identifier id'>seq_region_start</span><span class='rbrace token'>}</span>
  <span class='@transcript ivar id'>@transcript</span> <span class='assign token'>=</span> <span class='transcript identifier id'>transcript</span>
  <span class='@seq_region ivar id'>@seq_region</span> <span class='assign token'>=</span> <span class='@previous_exon ivar id'>@previous_exon</span><span class='dot token'>.</span><span class='seq_region identifier id'>seq_region</span>
  <span class='@seq_region_start ivar id'>@seq_region_start</span> <span class='assign token'>=</span> <span class='@previous_exon ivar id'>@previous_exon</span><span class='dot token'>.</span><span class='seq_region_end identifier id'>seq_region_end</span> <span class='plus op'>+</span> <span class='integer val'>1</span>
  <span class='@seq_region_end ivar id'>@seq_region_end</span> <span class='assign token'>=</span> <span class='@next_exon ivar id'>@next_exon</span><span class='dot token'>.</span><span class='seq_region_start identifier id'>seq_region_start</span> <span class='minus op'>-</span> <span class='integer val'>1</span>
  <span class='@seq_region_strand ivar id'>@seq_region_strand</span> <span class='assign token'>=</span> <span class='@previous_exon ivar id'>@previous_exon</span><span class='dot token'>.</span><span class='seq_region_strand identifier id'>seq_region_strand</span>
<span class='end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
  
</div>

  <div id="instance_attr_details" class="attr_details">
    <h2>Instance Attribute Details</h2>
    
      
      <span id="next_exon=-instance_method"></span>
      <span id="next_exon-instance_method"></span>
      <div class="method_details first">
  <p class="signature first" id="next_exon-instance_method">
  
    - (<tt>Object</tt>) <strong>next_exon</strong> 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>
Returns the value of attribute next_exon
</p>


  </div>
</div>
<div class="tags">
  
</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


32
33
34</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/ensembl/core/transcript.rb', line 32</span>

<span class='def def kw'>def</span> <span class='next_exon identifier id'>next_exon</span>
  <span class='@next_exon ivar id'>@next_exon</span>
<span class='end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
      
      <span id="previous_exon=-instance_method"></span>
      <span id="previous_exon-instance_method"></span>
      <div class="method_details ">
  <p class="signature " id="previous_exon-instance_method">
  
    - (<tt>Object</tt>) <strong>previous_exon</strong> 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>
Returns the value of attribute previous_exon
</p>


  </div>
</div>
<div class="tags">
  
</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


32
33
34</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/ensembl/core/transcript.rb', line 32</span>

<span class='def def kw'>def</span> <span class='previous_exon identifier id'>previous_exon</span>
  <span class='@previous_exon ivar id'>@previous_exon</span>
<span class='end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
      
      <span id="seq_region=-instance_method"></span>
      <span id="seq_region-instance_method"></span>
      <div class="method_details ">
  <p class="signature " id="seq_region-instance_method">
  
    - (<tt>Object</tt>) <strong>seq_region</strong> 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>
Returns the value of attribute seq_region
</p>


  </div>
</div>
<div class="tags">
  
</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


31
32
33</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/ensembl/core/transcript.rb', line 31</span>

<span class='def def kw'>def</span> <span class='seq_region identifier id'>seq_region</span>
  <span class='@seq_region ivar id'>@seq_region</span>
<span class='end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
      
      <span id="seq_region_end=-instance_method"></span>
      <span id="seq_region_end-instance_method"></span>
      <div class="method_details ">
  <p class="signature " id="seq_region_end-instance_method">
  
    - (<tt>Object</tt>) <strong>seq_region_end</strong> 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>
Returns the value of attribute seq_region_end
</p>


  </div>
</div>
<div class="tags">
  
</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


31
32
33</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/ensembl/core/transcript.rb', line 31</span>

<span class='def def kw'>def</span> <span class='seq_region_end identifier id'>seq_region_end</span>
  <span class='@seq_region_end ivar id'>@seq_region_end</span>
<span class='end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
      
      <span id="seq_region_start=-instance_method"></span>
      <span id="seq_region_start-instance_method"></span>
      <div class="method_details ">
  <p class="signature " id="seq_region_start-instance_method">
  
    - (<tt>Object</tt>) <strong>seq_region_start</strong> 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>
Returns the value of attribute seq_region_start
</p>


  </div>
</div>
<div class="tags">
  
</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


31
32
33</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/ensembl/core/transcript.rb', line 31</span>

<span class='def def kw'>def</span> <span class='seq_region_start identifier id'>seq_region_start</span>
  <span class='@seq_region_start ivar id'>@seq_region_start</span>
<span class='end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
      
      <span id="seq_region_strand=-instance_method"></span>
      <span id="seq_region_strand-instance_method"></span>
      <div class="method_details ">
  <p class="signature " id="seq_region_strand-instance_method">
  
    - (<tt>Object</tt>) <strong>seq_region_strand</strong> 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>
Returns the value of attribute seq_region_strand
</p>


  </div>
</div>
<div class="tags">
  
</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


31
32
33</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/ensembl/core/transcript.rb', line 31</span>

<span class='def def kw'>def</span> <span class='seq_region_strand identifier id'>seq_region_strand</span>
  <span class='@seq_region_strand ivar id'>@seq_region_strand</span>
<span class='end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
      
      <span id="transcript=-instance_method"></span>
      <span id="transcript-instance_method"></span>
      <div class="method_details ">
  <p class="signature " id="transcript-instance_method">
  
    - (<tt>Object</tt>) <strong>transcript</strong> 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>
Returns the value of attribute transcript
</p>


  </div>
</div>
<div class="tags">
  
</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


32
33
34</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/ensembl/core/transcript.rb', line 32</span>

<span class='def def kw'>def</span> <span class='transcript identifier id'>transcript</span>
  <span class='@transcript ivar id'>@transcript</span>
<span class='end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
  </div>


</div>
    
    <div id="footer">
  Generated on Wed Dec 15 19:18:14 2010 by 
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
  0.6.3 (ruby-1.8.7).
</div>

  </body>
</html>